package main

func main() {

	println(findComplement(1))
}

/**
 *	findComplement
 *	@Description: 异或求补
 *	@param num int
 *	@return int
 */
func findComplement(num int) int {
	i := 1
	for {
		if i > num {
			break
		}
		i = i << 1
	}
	i -= 1
	return i ^ num
}
